package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.CheckDetailModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.control.qct.businesssteward.utils.DecimalFormatUtils;
import com.control.qct.businesssteward.utils.GlideUtil;

import java.util.List;

/**
 * Created by Administrator on 2017/12/11 0011.
 */

public class CheckDetailAdapter extends BaseQuickAdapter<CheckDetailModel.DatasBean, BaseViewHolder> {
    public CheckDetailAdapter(@Nullable List<CheckDetailModel.DatasBean> data) {
        super(R.layout.rv_check_detail_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, CheckDetailModel.DatasBean item) {
        GlideUtil.loadImage(mContext,item.getImageSmallUrl(), (ImageView) holder.getView(R.id.iv_goods_picture));
        holder.setText(R.id.tv_goods_name, item.getTitle()).setText(R.id.tv_goods_barcode, item.getBarcode()).setText
                (R.id.tv_goods_price, "￥" + DecimalFormatUtils.DecimalFormatTwo(item.getSysPrice())).setText(R.id
                .tv_goods_type, item.getCategoryTitle()).setText(R.id.tv_check_num, item.getNumber() + "").setText(R
                .id.tv_unit, item.getUnit());
    }
}
